<?php
require "USServerList.php";
require "EUServerList.php";

// needs to return list of servers that match the specifications
$query = strtolower($_GET['s']);
$firstchar = strtolower(substr($_GET['s'],0,1));
$region = (strtolower($_GET['r']) == 'eu') ? $eu_server_list : $us_server_list;
if ($region[$firstchar]) {
	$slen = strlen($query);
	$count = 0;
	foreach ($region[$firstchar] as $server) {
		if ($query == strtolower(substr($server, 0, $slen))) {
			echo '<div class="normal" url="/">'.$server.'</div>';
			$count++;
			if ($count >= 8) break;
		}
	}
}
?>